home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Magazine 28 Bonus / CDRomMagazine-SoftKey-ArtPassion-FrenchVersion-Win31Mac.bin / data / shared.dir / 03023_Script_SET SECTION INFO < prev    next >
Text File  |  1996-06-21  |  7KB  |  202 lines

  1. -- ---------------------------------------------------------------
  2. -- Handler getSectionInfo returns the line in the global variable
  3. -- navigationInfo that contains the information for the given 
  4. -- section name.
  5.  
  6. on getSectionInfo sectionName
  7.   global navigationInfo
  8.   
  9.   set SectionInfoLine = BinSearchFirstItemInLine (navigationInfo, sectionName)
  10.   
  11.   if SectionInfoLine > 0 then return line SectionInfoLine of navigationInfo
  12.   
  13.   
  14.   -----------------------------------------------------------------------------
  15.   -- Error Handling. If data is correct, should not get here.
  16.   --
  17.   -- alert "Section Not Found: ""e§ionName"e&return&"Movie: "&the moviename&return&"Frame: "&the frame
  18.   return ""
  19.   -- should return current section info, so user will have least possible disturbance.
  20.   -----------------------------------------------------------------------------
  21.   
  22. end
  23.  
  24.  
  25. -- ---------------------------------------------------------------
  26. -- Handler setSectionMovie sets the global variable sectionMovie to
  27. -- the movie name of the section with the given section information.
  28.  
  29. on setSectionMovie sectionInfo
  30.   global sectionMovie
  31.   
  32.   set sectionMovie =  item 2 of sectionInfo
  33. end
  34.  
  35. -- ---------------------------------------------------------------
  36. -- Handler setSectionFrame sets the global variable sectionFrame to
  37. -- the frame name of the section with the given section information.
  38.  
  39. on setSectionFrame sectionInfo
  40.   global sectionFrame
  41.   
  42.   set sectionFrame = item 3 of sectionInfo
  43. end
  44.  
  45. -- ---------------------------------------------------------------
  46. -- Handler setLeftSection sets the global variable leftSection to
  47. -- the name of the section to the left of the section with the given
  48. -- section information. (This value will be 0 if no left section exists.)
  49.  
  50. on setLeftSection sectionInfo
  51.   global leftSection
  52.   
  53.   set leftSection = item 4 of sectionInfo
  54. end
  55.  
  56. -- ---------------------------------------------------------------
  57. -- Handler setRightSection sets the global variable rightSection to
  58. -- the name of the section to the right of the section with the given
  59. -- section information. (This value will be 0 if no left section exists.)
  60.  
  61. on setRightSection sectionInfo
  62.   global rightSection
  63.   
  64.   set rightSection = item 5 of sectionInfo
  65. end
  66.  
  67. -- ---------------------------------------------------------------
  68. -- Handler setTopSection sets the global variable topSection to
  69. -- the name of the section to the top of the section with the given
  70. -- section information. (This value will be 0 if no left section exists.)
  71.  
  72. on setTopSection sectionInfo
  73.   global topSection
  74.   
  75.   set topSection = item 6 of sectionInfo
  76. end
  77.  
  78. -- ---------------------------------------------------------------
  79. -- Handler setBottomSection sets the global variable bottomSection
  80. -- to the name of the section to the bottom of the section with the given
  81. -- section information. (This value will be 0 if no left section exists.)
  82.  
  83. on setBottomSection sectionInfo
  84.   global bottomSection
  85.   
  86.   set bottomSection = item 7 of sectionInfo
  87. end
  88.  
  89. -- ---------------------------------------------------------------
  90. -- Handler setParentSection sets the global variable parentSection
  91. -- to the name of the parent section of the section with the given
  92. -- section information. (This value will be 0 if no left section exists.)
  93.  
  94. on setParentSection sectionInfo
  95.   global parentSection
  96.   
  97.   set parentSection = item 8 of sectionInfo
  98. end
  99.  
  100. -- ---------------------------------------------------------------
  101. -- Handler getParentSection returns the parentSection of the given
  102. -- section information.
  103.  
  104. on getParentSection sectionInfo
  105.   return item 8 of sectionInfo
  106. end
  107.  
  108. -- ---------------------------------------------------------------
  109. -- Handler setNumSectionButtons sets the global variable
  110. -- numSectionButtons to the number of menu buttons in the section
  111. -- with the given section information.
  112.  
  113. on setNumSectionButtons sectionInfo
  114.   global numSectionButtons
  115.   
  116.   set numSectionButtons = value(item 9 of sectionInfo)
  117. end
  118.  
  119. -- ---------------------------------------------------------------
  120. -- Handler resetListOfButtonTexts 
  121.  
  122. on resetListOfButtonTexts
  123.   global listOfButtonTexts
  124.   set listOfButtonTexts = []
  125. end
  126.  
  127. -- ---------------------------------------------------------------
  128. -- Handler setButtonTexts sets the text for all the buttons in
  129. -- the section with the given section information.
  130.  
  131. on setButtonTexts sectionInfo
  132.   global numSectionButtons, listOfButtonTexts
  133.   
  134.   resetListOfButtonTexts
  135.   
  136.   repeat with i = 1 to numSectionButtons
  137.     add(listOfButtonTexts,getButtonText(sectionInfo, i))
  138.   end repeat
  139. end
  140.  
  141. -- ---------------------------------------------------------------
  142. -- Handler getButtonText returns the text of the button with the
  143. -- given buttonIndex in the section with the given section
  144. -- information.
  145.  
  146. on getButtonText sectionInfo, buttonIndex
  147.   global buttonItemOffset
  148.   
  149.   return word 1 of item (buttonItemOffset+buttonIndex) of sectionInfo
  150. end
  151.  
  152. -- ---------------------------------------------------------------
  153. -- Handler resetListOfButtonSections
  154.  
  155. on resetListOfButtonSections
  156.   global listOfButtonSections
  157.   set listOfButtonSections = []
  158. end
  159.  
  160. -- ---------------------------------------------------------------
  161. -- Handler setButtonSections sets the destination section for all
  162. -- the buttons in the section with the given section information.
  163.  
  164. on setButtonSections sectionInfo
  165.   global numSectionButtons, listOfButtonSections
  166.   
  167.   resetListOfButtonSections
  168.   
  169.   repeat with i = 1 to numSectionButtons
  170.     add(listOfButtonSections,getButtonSection(sectionInfo, i))
  171.   end repeat
  172. end
  173.  
  174. -- ---------------------------------------------------------------
  175. -- Handler getButtonSection returns the name of the section to go
  176. -- to when the button with the given buttonIndex in the section with
  177. -- the given section information is clicked.
  178.  
  179. on getButtonSection sectionInfo, buttonIndex
  180.   global buttonItemOffset
  181.   
  182.   return word 2 of item (buttonItemOffset+buttonIndex) of sectionInfo
  183. end
  184.  
  185. -- ---------------------------------------------------------------
  186. -- Handler setSectionOrientation sets the global variable
  187. -- sectionOrientation to the orientation of the section
  188. -- with the given section information.
  189.  
  190. on setSectionOrientation sectionInfo
  191.   global sectionOrientation
  192.   
  193.   set sectionOrientation =  item 13 of sectionInfo
  194. end
  195.  
  196. -- ---------------------------------------------------------------
  197. -- Handler getSectionOrientation returns the orientation in the
  198. -- given section information
  199.  
  200. on getSectionOrientation sectionInfo
  201.   return item 13 of sectionInfo
  202. end